Do not try to monkey patch the mysql adapter on heroku

Dominik Sander %!s(int64=9) %!d(string=hace) años
padre
commit
8c9fb4b678
Se han modificado 1 ficheros con 8 adiciones y 7 borrados
  1. 8 7
      config/initializers/mysqlpls.rb

+ 8 - 7
config/initializers/mysqlpls.rb

@@ -1,13 +1,14 @@
1 1
 # see https://github.com/rails/rails/issues/9855#issuecomment-28874587
2 2
 # circumvents the default InnoDB limitation for index prefix bytes maximum when using proper 4byte UTF8 (utf8mb4)
3 3
 # (for server-side workaround see http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix)
4
+if ENV['ON_HEROKU'].nil?
5
+  require 'active_record/connection_adapters/abstract_mysql_adapter'
4 6
 
5
-require 'active_record/connection_adapters/abstract_mysql_adapter'
6
-
7
-module ActiveRecord
8
-  module ConnectionAdapters
9
-    class AbstractMysqlAdapter
10
-      NATIVE_DATABASE_TYPES[:string] = { :name => "varchar", :limit => 191 }
7
+  module ActiveRecord
8
+    module ConnectionAdapters
9
+      class AbstractMysqlAdapter
10
+        NATIVE_DATABASE_TYPES[:string] = { :name => "varchar", :limit => 191 }
11
+      end
11 12
     end
12 13
   end
13
-end
14
+end